package thread.example;

/**
 * Created by simod on 2019/12/21
 */
public class ThreadTest {
    public static void main(String[] args) {
        RunningMan cwt = new RunningMan("cwt");
        RunningMan s = new RunningMan("s");
        RunningMan b = new RunningMan("b");
        Thread r1 = new Thread(cwt);
        Thread r2 = new Thread(s);
        Thread r3 = new Thread(b);
        r1.start();
        r2.start();
        r3.start();

    }
}

class RunningMan implements Runnable {
    private String name;

    public RunningMan() {
    }

    public RunningMan(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System12306.out.println(this.name + "跑了" + i + "米");
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
